'use strict'
var path = require('path');
var util = require('../libs/util');
var wechat_file = path.join(__dirname, './token.txt')
var wechat_ticket_file = path.join(__dirname, './wechat_ticket.json')

var config = {
	wechat: {
		appId: 'wx8adf122f1d98838b',
		appSecret: '2b14138dd72b8c1ab75bcb0c5d1795fc',
		token: 'wx8adf122f1d98838b',
		getAccessToken: function () {
			return util.readFileAsync(wechat_file)
		},
		saveAccessToken: function (data) {
			data = JSON.stringify(data);
			return util.writeFileAsync(wechat_file, data)

		},
		getTicket: function () {
			return util.readFileAsync(wechat_ticket_file)
		},
		saveTicket: function (data) {
			data = JSON.stringify(data);
			return util.writeFileAsync(wechat_ticket_file, data)

		},
	}
}

module.exports = config;